import axios from '../request';

interface TagSaveType {
  id?: number;
  name: string;
  projectId: number;
  parentId: number;
  sort?: number;
  showpieceId?: number;
}
// 标签列表数据
export const tagList = (projectId: number) => {
  return axios.get<any>(`api/tag/list/${projectId}`, {});
};
//保存标注
export const tagSave = (parmas: TagSaveType) => {
  return axios.post<any>(`api/tag/save`, parmas);
};
//删除标注
export const delTag = (projectId: number, id: number) => {
  return axios.delete<any>(`api/tag/${projectId}/${id}`, {});
};
//获取展品标注
export const tagDetail = (projectId: number, showpieceId: number) => {
  return axios.get<any>(`api/tag/showpiece/${projectId}/${showpieceId}`, {});
};
//删除展品标注
export const delExbitionTag = (projectId: number, id: number, showpieceId: number) => {
  return axios.delete<any>(`api/tag/${projectId}/${id}/${showpieceId}`, {});
};
//绑定展品标注
export const bindTag = (projectId: number, showpieceId: number, parmas: Array<number>) => {
  return axios.put<any>(`api/tag/bind/${projectId}/${showpieceId}`, parmas);
};
